{% extends "DrinkiitBlogBundle::layout.html.twig" %}

{% block title %}{{ titre }}{% endblock %}

{% block suiveur %} <a href="{{ path('homepage') }}">Accueil</a> > 
{% if section == "contact" %}<a href="{{ path('visitor_contact') }}">Contact</a>
{% else %}
<a href="{{ path('visitor_suggestion') }}">Suggestion</a>
{% endif %}
{% endblock %}

{% block content %}

<h1>{{ section }}</h1>

<form method="post" {{ form_enctype(form) }}>
	
	{{ form_errors(form) }}
	
	<div>
		{{ form_label(form.pseudo) }}
		{{ form_errors(form.pseudo) }}
		{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
			{{ form_widget(form.pseudo, {'attr': { 'value': app.security.token.user} }) }}
		{% else %}
			{{ form_widget(form.pseudo) }}
		{% endif %}
	</div>
	<div>
		{{ form_label(form.mail) }}
		{{ form_errors(form.mail) }}
		{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
			{{ form_widget(form.mail, {'attr': { 'value': app.security.token.user.email} }) }}
		{% else %}
			{{ form_widget(form.mail) }}
		{% endif %}
	</div>
	<div>
		{{ form_label(form.message) }}
		{{ form_errors(form.message) }}
		{{ form_widget(form.message, {'attr': { 'cols': 40, 'rows': 10 } }) }}
	</div>
	<div>
		{{ form_label(form.captcha) }}
		{{ form_errors(form.captcha) }}
		{{ form_widget(form.captcha) }}
	</div>
	
	{{ form_widget(form.section, { 'attr': { 'value': section } }) }}
	<input id="submit" type="submit" />
	{{ form_rest(form) }}
</form>

{% endblock %}
